* @param string &$s HTML to update
* @param Title $title
* @param string $logtype
+ * @param bool $useParentheses (optional) Wrap log entry in parentheses where needed
*/
- public function insertLog( &$s, $title, $logtype ) {
+ public function insertLog( &$s, $title, $logtype, $useParentheses = true ) {
$page = new LogPage( $logtype );
$logname = $page->getName()->setContext( $this->getContext() )->text();
- $s .= Html::rawElement( 'span', [
- 'class' => 'mw-changeslist-links'
- ], $this->linkRenderer->makeKnownLink( $title, $logname ) );
+ $link = $this->linkRenderer->makeKnownLink( $title, $logname, [
+ 'class' => $useParentheses ? '' : 'mw-changeslist-links'
+ ] );
+ if ( $useParentheses ) {
+ $s .= $this->msg( 'parentheses' )->rawParams(
+ $link
+ )->escaped();
+ } else {
+ $s .= $link;
+ }
}
/**
if ( $rc->mAttribs['rc_log_type'] ) {
$logtitle = SpecialPage::getTitleFor( 'Log', $rc->mAttribs['rc_log_type'] );
- $this->insertLog( $html, $logtitle, $rc->mAttribs['rc_log_type'] );
+ $this->insertLog( $html, $logtitle, $rc->mAttribs['rc_log_type'], false );
$flags = $this->recentChangesFlags( [ 'unpatrolled' => $unpatrolled,
'bot' => $rc->mAttribs['rc_bot'] ], '' );
if ( $flags !== '' ) {
list( $name, $htmlubpage ) = MediaWikiServices::getInstance()->getSpecialPageFactory()->
resolveAlias( $rc->mAttribs['rc_title'] );
if ( $name == 'Log' ) {
- $this->insertLog( $html, $rc->getTitle(), $htmlubpage );
+ $this->insertLog( $html, $rc->getTitle(), $htmlubpage, false );
}
// Regular entries
} else {